package com.xdh.springcloud.producer.helloword.service.impl;

import com.xdh.springcloud.producer.helloword.bean.User;
import com.xdh.springcloud.producer.helloword.service.HelloWordServiceRemote;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RefreshScope
public class HelloWordServiceImpl implements HelloWordServiceRemote {

    @Value(value = "${server.port}")
    private String port;

    @Override
    public String sayHello(String name) {
        return "hello. " + "  port=" + port;
    }

    @Override
    public User sayHello(@RequestBody User user) {
        return user;
    }
}
